package com.iraeta.controller;

import com.iraeta.common.AuthAccess;
import com.iraeta.controller.BaseController;

import com.iraeta.service.etl.ErpEtlService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;


@RestController(value = "TestController")
@RequestMapping("test")
public class TestController extends BaseController {
    private static final Logger logger = LoggerFactory.getLogger(TestController.class);

    @Autowired
    ErpEtlService erpEtlService;

    @RequestMapping("test1")
    @AuthAccess
    public String test1(){
        logger.info("test1");
        return "{ok:123}";
    }

    @RequestMapping("test2")
    @AuthAccess
    public String test2(){
        logger.info("test2 begin");
        erpEtlService.processErpCurrentStore();
        logger.info("test2 end");
        return "{ok:test2}";
    }
}
